<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BaseAction
 *
 * @author Administrator
 */
import('@.Service.SessionService');
import('@.Service.ConfigService');
import('@.Service.AdService');
import('@.Service.FriendlyLinkService');
//Load('extend');
class BaseAction extends Action {

    function _initialize() {
        $sessionId = Session::id();

        $sessionService = new SessionService();
        if (!$sessionService->isExist($sessionId)) {
            $sessionService->insert(array('sessionid' => $sessionId, 'datetime' => date('Y-m-d H:m:s')));
        }

        $this->publicFunction();
    }

    private function publicFunction() {
        //页头显示 文字
        $configService = new ConfigService();
        $demagogic = $configService->getConfig('demagogic');
        $this->assign("demagogic", $demagogic);
//
        //页脚显示网站信息
        $fooler_info_config = $configService->getConfigValue('fooler_info_config');
        $this->assign("fooler_info_config", $fooler_info_config);
//        $listConfig = $configService->getConfigValues('email,qq,fax');
//        $this->assign("listConfig", $listConfig);
//        $this->assign("listConfigCount", count($listConfig));
//        
//        //页脚显示友链
//        $flService = new FriendlyLinkService();
//        $listFL = $flService->listAll();
//        $this->assign("listFL", $listFL);
//        $this->assign("listFLCount", count($listFL));
        //底部广告
        $adService = new AdService();
        $this->assign('bottomAd', $adService->findAdByLocation('content_bottom'));
        
        //新浪一键关注
        $this->assign('sina_a_key_concern', $configService->getConfigValue('a_key_concern'));
    }

}

?>
